<template>
  <div class="stat-item">
    <div class="stat-icon" :class="icon"></div>
    <div class="stat-value">
      <span class="num">{{ value }}</span>
      <span class="unit">{{ unit }}</span>
    </div>
    <div class="stat-label">{{ label }}</div>
  </div>
</template>

<script setup>
const props = defineProps({
  icon: { type: String, required: true },
  value: { type: String, required: true },
  unit: { type: String, default: '' },
  label: { type: String, required: true }
});
</script>

<style scoped>
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
.stat-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
/* 自定义图标背景（可替换为 SVG/Iconfont） */
.ticket { background-image: url("../../assets/3.png"); }
.process { background-image: url("../../assets/1.png"); }
.wait { background-image: url("../../assets/11.png"); }
.time { background-image: url("../../assets/111.png"); }

.stat-value {
  display: flex;
  align-items: baseline;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 4px;
}
.num { font-size: 32px; }
.unit { font-size: 16px; opacity: 0.8; }

.stat-label {
  font-size: 14px;
  opacity: 0.9;
}
</style>